// 调用封装好的调用接口函数
import {get, post } from '../util/request';
// 首页-发现  可获取 APP 首页信息
export const reqShouYe = (uid) => get(`/homepage/block/page`);
// 轮播图banner
export const reqBanner = (uid) => get(`/banner`);

// 搜索
export const reqSearch = (keywords) => get(`/cloudsearch?keywords=${keywords}`);
//获取用户歌单
export const reqPlaylist = (uid) => get(`/user/playlist?uid=${uid}`);

// 歌单分类
export const reqCatList = () => get(`/playlist/catlist`);
// 歌单 ( 网友精选碟 )
export const reqTopPlaylist = () => get(`/top/playlist?limit=50&order=new`);
// 获取歌单详情
export const reqDetailList = (id) => get(`/playlist/detail?id=${id}`);
// 获取歌单所有歌曲
export const reqAllList = (id) => get(`/playlist/track/all?id=${id}`);
// 新建歌单
export const reqCreateList = (name) => get(`/playlist/create?name=${name}`);
// 删除歌单  歌单 id,可多个,用逗号隔开
export const reqDeleteList = (id) => get(`/playlist/delete?id=${id}`);
// 对歌单添加或删除歌曲
/*
op: 从歌单增加单曲为 add, 删除为 del
pid: 歌单 id 
tracks: 歌曲 id,可多个,用逗号隔开
*/
export const reqTracksList = (op, pid, id) => get(`/playlist/tracks?op=${op}&pid=${pid}&tracks=${id}`);

// ........................................歌曲

// 获取歌曲详情   传入音乐 id(支持多个 id, 用 , 隔开), 可获得歌曲详情(dt为歌曲时长)
export const reqSongDetail = (id) => get(`/song/detail?ids=${id}`);

// 获取歌词
export const reqLyric = (id) => get(`/lyric?id=${id}`);
// 歌曲评论
export const reqPingLun = (id) => get(`/comment/music?id=${id}`);
// 更新歌单
/*
id:歌单id
name:歌单名字
desc:歌单描述
tags:歌单tag ,多个用 `;` 隔开,只能用官方规定标签
 */
export const reqPlayUpdate = (id, name, desc, tags) => get(`/playlist/update?id=${id}&name=${name}&desc=${desc}&tags=${tags}`);

// 歌单封面上传
export const reqCoverUpload = (id) => get(`/playlist/cover/update?id=${id}&imgSize=200`);


// 获取动态评论
export const reqCommentEvent = (id) => get(`/comment/event?threadId=${id}`);

// 获取用户播放记录
export const reqUserRecord = (id) => get(`/user/record?uid=${id}&type=1`);

//获取热门话题
export const reqTopic = () => get(`/hot/topic?limit=30&offset=30`);
// 获取话题详情
export const reqTopicDetail = () => get(`/topic/detail/event/hot?actid=111551188`);